<?php
	header("Content-Type: text/html;charset=utf-8");
	include("../_judge.php");
	include("../../function/function.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?= $adminweb_titles ?></title>
<link href="../css/style.css" rel="stylesheet" type="text/css" />
<script>if (top.location != parent.location||self.location==top.location){top.location.replace('../login/admin.php')}</script>
<script language="javascript" src="../script/jquery-1.7.2.min.js"></script>
<script language="javascript" src="../script/My97DatePicker/WdatePicker.js"></script>
<link rel="stylesheet" href="../../SunbeamEditor/themes/default/default.css" />
<script charset="utf-8" src="../../SunbeamEditor/kindeditor.js"></script>
<script charset="utf-8" src="../../SunbeamEditor/lang/zh_CN.js"></script>
<script language="javascript">
$(document).ready(function(){
	$("#myform").submit(function(){
		var webad_title = $("#webad_title").val();
		var webad_content = $("#webad_content").val();

		if (webad_title.replace(/\ /g,"").length<1){
			alert("信息标题不能为空！");
			$("#webad_title").focus();
			return false;
		}
		if(webad_content.replace(/\ /g,"").length<1){
			alert("信息内容不能为为空！");
			$("#webad_content").focus();
			return false;
		}
	});
});
</script>


</head>

<body>
<table width="97%" border="0" align="center" cellpadding="5" cellspacing="0">
  <tr>
    <td><strong>后台管理</strong>&nbsp;-&nbsp;<span class="hong"><strong>消息发布</strong></span></td>
  </tr>

</table>
<form id="myform" name="myform" method="post" action="newsaddsave.php?action=add">
<table width="97%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#333333">
    <tr>
      <td width="80" align="right" bgcolor="#EFEFEF">信息标题：</td>
      <td bgcolor="#EFEFEF"><input name="webad_title" type="text" id="webad_title" size="50" />
      &nbsp;<span class="hong">*</span></td>
    </tr>
    <tr>
      <td align="right" bgcolor="#EFEFEF">目标用户：</td>
      <td bgcolor="#EFEFEF">
	  <select name="userid[]" size="15" multiple="multiple">
	  <?php
	  		$user_sql = "select * from kboy_user order by uid desc";
			$user_rows = mysql_query($user_sql);
			while($user_rs = mysql_fetch_array($user_rows)){
				echo "<option value=\"".$user_rs['uid']."\" selected>".getUserNickName($user_rs['uid'])."</option>";
			}
	  ?>
      </select>
      </td>
    </tr>
    <tr>
      <td align="right" bgcolor="#EFEFEF">信息内容：</td>
      <td bgcolor="#EFEFEF"><textarea name="webad_content" cols="70" rows="4" id="webad_content"></textarea></td>
    </tr>
    <tr>
      <td bgcolor="#EFEFEF">&nbsp;</td>
      <td bgcolor="#EFEFEF"><input type="submit" name="Submit" value="提交保存" />
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <input type="reset" name="Submit2" value="重置取消" /></td>
    </tr>
</table>
</form>
</body>
</html>
